<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateXkClueChangeOwnerRecord extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('xk_clue_change_owner_record', function (Blueprint $table) {
            $table->id();

            $table->string("clueId")->default("")->comment("线索id");
            $table->unsignedInteger("newOwnerId")->default(0)->comment("线索新所属人wid");
            $table->unsignedTinyInteger("isMerchants")->default(0)->comment("是否为招商人员");
            $table->unsignedBigInteger("buildTime")->default(0)->comment("操作时间,时间戳");
            $table->unsignedBigInteger("operateWid")->default(0)->comment("操作用户wid");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '销氪 - 线索所属人变更记录';
            $table->index(["clueId"], "idx_clueId");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('xk_clue_change_owner_record');
    }
}
